// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import './styles/index.css';
import axios from 'axios';
import MintUi from 'mint-ui';
import 'mint-ui/lib/style.css';
Vue.use(MintUi);
Vue.prototype.$http= axios
Vue.prototype.AppURL = 'http://localhost:8083'
Vue.config.productionTip = false
import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css";
Vue.use(Viewer);
Viewer.setDefaults({
  Options: {
    inline: true,
    button: true,
    navbar: true,
    title: true,
    toolbar: true,
    tooltip: true,
    movable: true,
    zoomable: true,
    rotatable: true,
    scalable: true,
    transition: true,
    fullscreen: true,
    keyboard: true,
    url: "data-source"
  }
});
axios.interceptors.request.use(function (config) {
  // var w=window.localStorage.getItem('token');
  // if(w!=null && w!=undefined && w!="null" && w!="undefined"){
  //   config.headers['Authorization'] = "Bearer"+window.localStorage.getItem('token')
  // }
  var w=window.localStorage.getItem('userid');
  if(w!=null && w!=undefined && w!="null" && w!="undefined"){
    config.headers['userId'] = localStorage.userid
  }
  return config
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  MintUi,
  components: { App },
  template: '<App/>'
})
